Learn everything you need to know about Algolia records, including attributes, types, limits, formatting, nesting, and more.
Format | Example |
---|---|
string | "title": "Breaking Bad" |
integer | "like_count": 978 |
float | "avg_rating": 1.23456 |
boolean | "featured": true |
objects | "lead_role": { "name": "Walter White", "portrayed_by": "Bryan Cranston" } |
arrays | "episodes": ["Crazy Handful of Nothin'", "Gray Matter"] |
like_count
attribute as a number, not a string.objectID
attribute is a unique identifier for each record.
You should set objectID
s yourself, based on your data. Since you use objectID
s to update and delete specific records, it’s easier if you’ve defined them yourself. If you don’t set objectID
s, Algolia generates them for you: you can check their values by browsing the index.
When you retrieve objects, objectID
s are in string format, even if you set them as integers. If you want to use integers in your app, convert objectID
into integers after retrieving the objects but make sure that all your objectID
s contain integer values.
Since objectID
uniquely identifies your objects:
searchableAttributes
.objectID
in attributesToHighlight
or attributesToSnippet
, the engine ignores it.objectID
in unretrievableAttributes
or omit it from attributesToRetrieve
, the engine still returns it. For this reason, objectID
s mustn’t contain any sensitive data.objectID
in attributesForFaceting
, the engine ignores it. Faceting on a unique identifier makes little sense since every facet count would equal one.objectID
sobjectID
strings can:
1435735848
).
To convert ISO 8601 formatted dates to Unix timestamps, use the appropriate function for your chosen programming language:
Date()
time.Unix
getTime()
getTime()
kotlinx-datetime
ToUnixTimeSeconds
strtotime
datetime
date.to_time
NSDate(withTimeIntervalSince1970:)
distinctSeqId
_geoloc
_highlightResult
_rankingInfo
snippetResult
_tags
_tags
or _geoloc
attribute names but they have an imposed schema.
Other attribute names are schema-agnostic.
Reserved words aren’t searchable by default.
If you want to search _tags
or _geoloc
, you must add them to your searchableAttributes
.
_highlightResult
, _snippetResult
, _rankingInfo
, and _distinctSeqID
in the search response.
They’re reserved Algolia attributes tied to specific features.
To avoid conflicts, don’t specify these attribute names in your records.